inherited frmBuildingTraits: TfrmBuildingTraits
  Left = 396
  Top = 166
  Width = 726
  Height = 363
  Caption = #1055#1088#1080#1079#1085#1072#1082#1080' '#1089#1090#1088#1086#1077#1085#1080#1103
  Constraints.MinHeight = 360
  Constraints.MinWidth = 720
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel1: TPanel
    Top = 309
    Width = 718
    inherited BitBtn1: TBitBtn
      Left = 511
      Visible = False
    end
    inherited BitBtn2: TBitBtn
      Left = 613
    end
  end
  inherited ToolBar1: TToolBar
    Width = 718
    Height = 0
    Visible = False
  end
  object dbgAllowTraits: TDBGridEh [2]
    Left = 0
    Top = 0
    Width = 320
    Height = 309
    Align = alLeft
    DataGrouping.GroupLevels = <>
    DataSource = dscAllowTraits
    Flat = True
    FooterColor = clWindow
    FooterFont.Charset = DEFAULT_CHARSET
    FooterFont.Color = clWindowText
    FooterFont.Height = -11
    FooterFont.Name = 'MS Sans Serif'
    FooterFont.Style = []
    Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
    OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghFitRowHeightToText, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove, dghExtendVertLines]
    RowDetailPanel.Color = clBtnFace
    RowHeight = 2
    RowLines = 1
    TabOrder = 2
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
    UseMultiTitle = True
    VTitleMargin = 5
    Columns = <
      item
        EditButtons = <>
        FieldName = 'NAME'
        Footers = <>
      end
      item
        EditButtons = <>
        FieldName = 'CODE'
        Footers = <>
        Visible = False
      end>
    object RowDetailData: TRowDetailPanelControlEh
    end
  end
  object Panel2: TPanel [3]
    Left = 320
    Top = 0
    Width = 398
    Height = 309
    Align = alClient
    BevelOuter = bvNone
    TabOrder = 3
    object dbgBuildingTraits: TDBGridEh
      Left = 23
      Top = 0
      Width = 375
      Height = 309
      Align = alClient
      DataGrouping.GroupLevels = <>
      DataSource = dscBuildingTraits
      Flat = True
      FooterColor = clWindow
      FooterFont.Charset = DEFAULT_CHARSET
      FooterFont.Color = clWindowText
      FooterFont.Height = -11
      FooterFont.Name = 'MS Sans Serif'
      FooterFont.Style = []
      Options = [dgTitles, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
      OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghFitRowHeightToText, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghExtendVertLines]
      RowDetailPanel.Color = clBtnFace
      RowHeight = 2
      RowLines = 1
      TabOrder = 0
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clWindowText
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = []
      UseMultiTitle = True
      VTitleMargin = 5
      Columns = <
        item
          EditButtons = <>
          FieldName = 'NAME'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'CODE'
          Footers = <>
          Visible = False
        end
        item
          EditButtons = <>
          FieldName = 'VIEW_VALUE'
          Footers = <>
          Width = 85
        end
        item
          EditButtons = <>
          FieldName = 'BDATE'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'EDATE'
          Footers = <>
        end>
      object RowDetailData: TRowDetailPanelControlEh
      end
    end
    object ToolBar2: TToolBar
      Left = 0
      Top = 0
      Width = 23
      Height = 309
      Align = alLeft
      AutoSize = True
      Caption = 'ToolBar2'
      EdgeBorders = []
      Flat = True
      Images = MAIN.ImageList
      TabOrder = 1
      object ToolButton5: TToolButton
        Left = 0
        Top = 0
        Action = aNewTrait
        Wrap = True
      end
      object ToolButton6: TToolButton
        Left = 0
        Top = 22
        Action = aEditTrait
        Wrap = True
      end
      object ToolButton7: TToolButton
        Left = 0
        Top = 44
        Action = aDelTrait
      end
    end
  end
  inherited ActionList1: TActionList
    Images = MAIN.ImageList
    Left = 88
    Top = 8
    inherited aCancel: TAction
      OnExecute = aCancelExecute
    end
    object aNewTrait: TAction
      Hint = #1053#1072#1079#1085#1072#1095#1080#1090#1100' '#1085#1086#1074#1099#1081' '#1087#1088#1080#1079#1085#1072#1082' '#1072#1073#1086#1085#1077#1085#1090#1091
      ImageIndex = 23
      OnExecute = aNewTraitExecute
    end
    object aDelTrait: TAction
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1074#1099#1073#1088#1072#1085#1085#1099#1081' '#1087#1088#1080#1079#1085#1072#1082' '#1089' '#1072#1073#1086#1085#1077#1085#1090#1072
      ImageIndex = 24
      OnExecute = aDelTraitExecute
    end
    object aEditTrait: TAction
      Hint = #1048#1079#1084#1077#1085#1080#1090#1100' '#1079#1085#1072#1095#1077#1085#1080#1077'/'#1087#1077#1088#1080#1086#1076' '#1076#1077#1081#1089#1090#1074#1080#1103' '#1087#1088#1080#1079#1085#1072#1082#1072
      ImageIndex = 5
      OnExecute = aEditTraitExecute
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'TfrmBuildingTraits'
    StoredProps.Strings = (
      '<P>.Height'
      '<P>.Left'
      '<P>.PixelsPerInch'
      '<P>.Top'
      '<P>.Width'
      '<P>.WindowState'
      'dbgAllowTraits.<P>.Columns.<ForAllItems>.Width'
      'Panel2.dbgBuildingTraits.<P>.Columns.<ForAllItems>.Width')
    Left = 120
    Top = 8
  end
  object dsAllowTraits: TpFIBDataSet
    SelectSQL.Strings = (
      'select ab.id, ab.name, ab.code from building_traits ab'
      '  where not exists (select 1 from buildings2traits a2t'
      '      where a2t.is_deleted = 0'
      '        and a2t.traits_id = ab.id'
      '        and (a2t.bdate <= current_date or a2t.bdate is null)'
      '        and (a2t.edate >= current_date or a2t.edate is null)'
      '        and a2t.building_id = :pbuilding_id)'
      '  order by 2')
    Transaction = trLocal
    Database = MAINDM.pMainDatabase
    Left = 184
    Top = 64
    object dsAllowTraitsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsAllowTraitsNAME: TFIBStringField
      DisplayLabel = #1044#1086#1089#1090#1091#1087#1085#1099#1077' '#1087#1088#1080#1079#1085#1072#1082#1080
      DisplayWidth = 30
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsAllowTraitsCODE: TFIBStringField
      FieldName = 'CODE'
      Size = 16
      EmptyStrToNull = True
    end
  end
  object trLocal: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 216
    Top = 64
  end
  object dsBuildingTraits: TpFIBDataSet
    DeleteSQL.Strings = (
      'UPDATE BUILDINGS2TRAITS'
      'SET '
      '    IS_DELETED = 1'
      'WHERE'
      '    ID = :OLD_ID')
    RefreshSQL.Strings = (
      
        'select a2t.id, ab.name, ab.code, a2t.view_value, a2t.bdate, a2t.' +
        'edate,'
      '       a2t.traits_id'
      '  from building_traits ab'
      '  join buildings2traits a2t on a2t.is_deleted = 0'
      '    and a2t.traits_id = ab.id'
      '    and a2t.building_id = :pbuilding_id'
      '    and a2t.id = :OLD_ID'
      '  ')
    SelectSQL.Strings = (
      
        'select a2t.id, ab.name, ab.code, a2t.view_value, a2t.bdate, a2t.' +
        'edate,'
      '       a2t.traits_id'
      '  from building_traits ab'
      '  join buildings2traits a2t on a2t.is_deleted = 0'
      '    and a2t.traits_id = ab.id'
      '    and a2t.building_id = :pbuilding_id'
      '  order by a2t.bdate desc, a2t.edate desc nulls last, ab.name')
    Transaction = trLocal
    Database = MAINDM.pMainDatabase
    Left = 456
    Top = 80
    object dsBuildingTraitsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsBuildingTraitsNAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1085#1072#1095#1077#1085#1085#1099#1077' '#1087#1088#1080#1079#1085#1072#1082#1080
      DisplayWidth = 25
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsBuildingTraitsCODE: TFIBStringField
      FieldName = 'CODE'
      Size = 16
      EmptyStrToNull = True
    end
    object dsBuildingTraitsVIEW_VALUE: TFIBStringField
      DisplayLabel = #1047#1085#1072#1095#1077#1085#1080#1077' '#1087#1088#1080#1079#1085#1072#1082#1072
      DisplayWidth = 20
      FieldName = 'VIEW_VALUE'
      Size = 255
      EmptyStrToNull = True
    end
    object dsBuildingTraitsBDATE: TFIBDateField
      DisplayLabel = #1055#1077#1088#1080#1086#1076'|'#1089
      FieldName = 'BDATE'
    end
    object dsBuildingTraitsEDATE: TFIBDateField
      DisplayLabel = #1055#1077#1088#1080#1086#1076'|'#1087#1086
      FieldName = 'EDATE'
    end
    object dsBuildingTraitsTRAITS_ID: TFIBIntegerField
      FieldName = 'TRAITS_ID'
    end
  end
  object dscAllowTraits: TDataSource
    DataSet = dsAllowTraits
    Left = 184
    Top = 96
  end
  object dscBuildingTraits: TDataSource
    DataSet = dsBuildingTraits
    Left = 456
    Top = 112
  end
end
